package route

import (
	"cooke-home/auth-service/di"
	"log"

	"github.com/gin-gonic/gin"
)

var Router *gin.Engine

func InitRouter() {
	log.Println("开始初始化路由...")
	Router = gin.Default()

	Router.GET("/health", func(c *gin.Context) {
		c.JSON(200, gin.H{
			"status":  "ok",
			"message": "pong",
		})
	})

	userGroup := Router.Group("/user")
	{
		userGroup.POST("/login", di.UserController.Login)
		userGroup.POST("/refresh", di.UserController.Refresh)
	}

	log.Println("路由初始化完成")
}
